package lianxi;

import java.util.Arrays;

public class 第一题 {
    public static void main(String[] args) {
        int[] a = new int[10];
        int[] b = new int[10];
        System.out.print("第一个数组为");
        for (int i = 0; i < a.length; i++) {
            a[i] = (int) (Math.random() * 100);
            System.out.print(a[i]+" ");
        }
        System.out.println();
        System.out.print("第二个数组为");
        for (int i = 0; i < b.length; i++) {
            b[i] = (int) (Math.random() * 100);
            System.out.print(b[i]+" ");
        }
        System.out.println();
        System.out.println("b的长度为"+b.length);
        b = Arrays.copyOf(b, b.length + 3);
        System.out.println("第二个数组长度为" + b.length);
        System.arraycopy(a,2,b,10,3);
        System.out.print("扩容后的数组为");
        for (int i = 0; i < b.length; i++) { ;
            System.out.print(b[i]+" ");
        }
    }
}